{layout name="public/tab_layout" /}
<div class="layui-container">  
<div class="layui-row">
<div class="layui-col-xs10 layui-col-xs-offset1">

        <form class="layui-form" action="">
                <div class="layui-form-item">
                        <label class="layui-form-label">类型</label>
                        <div class="layui-input-inline">
                                <select name="type"  lay-search="">
                                  <option value="1">物料</option>
                                  <option value="0">名称</option>
                                </select>
                        </div>
                </div>
                <div class="layui-form-item">
                        <label class="layui-form-label">P/N</label>
                        <div class="layui-input-inline">
                          <input type="text" name="pn" autocomplete="off" class="layui-input"  value="{$info.pn}">
                        </div>
                </div>
                <div class="layui-form-item">
                        <label class="layui-form-label">S/N</label>
                        <div class="layui-input-inline">
                          <input type="text" name="sn" autocomplete="off" class="layui-input"  value="{$info.sn}">
                        </div>
                </div>
                <div class="layui-form-item">
                  <label class="layui-form-label">物料名称</label>
                  <div class="layui-input-inline">
                    <input type="text" name="name"autocomplete="off" placeholder="请输入名称" class="layui-input" value="{$info.name}">
                  </div>
                </div>
                <div class="layui-form-item">
                        <label class="layui-form-label">型号</label>
                        <div class="layui-input-inline">
                          <input type="text" name="model" autocomplete="off" class="layui-input"  value="{$info.model}">
                        </div>
                </div>
                <div class="layui-form-item">
                        <label class="layui-form-label">数量</label>
                        <div class="layui-input-inline">
                          <input type="text" name="quantity" autocomplete="off" class="layui-input"  value="{$info.quantity}">
                        </div>
                </div>
                <div class="layui-form-item">
                        <label class="layui-form-label">描述</label>
                        <div class="layui-input-inline">
                          <input type="text" name="text"  autocomplete="off"class="layui-input" value="{$info.text}">
                        </div>
                </div>

        </form>
        
</div>
</div>

<div class="layui-row">
        <div class="layui-col-xs4 layui-col-xs-offset4">

                <div class="layui-btn-group">
                    <button class="layui-btn layui-btn-normal btn_print">打印</button>
                </div>
        </div>
</div>      

</div>

<script>
layui.use('form', function(){
    var form = layui.form;
});
//绑定按钮
$(function(){
    $('.btn_print').on('click',function(){
	    //读取输入框的值
	    var value = {
            name: $("input[name='name']").val(),
            type: $("select[name='type']").val(),
            text: $("input[name='text']").val(),
            pn: $("input[name='pn']").val(),
            sn: $("input[name='sn']").val(),
            model: $("input[name='model']").val(),
            quantity: $("input[name='quantity']").val(),
        };
        $.post("{:url('Warehouse/Label/putprint')}", value,
            function(ret) {
            var status = "1" == ret.status ? "success": "error";
            if(status == "success"){
                layer.msg('操作成功！'); //2秒后自动关闭，-1代表不显示图标
            }
            
        },"json")
    })

})
</script>